home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / util / rexx / WebChat.lha / webchat / GBInstall < prev    next >
Encoding:
Text File  |  1997-10-31  |  6.0 KB  |  182 lines

  1. ; Installer for WebChat V1.0
  2. ;   1.0 - It works but needs support for mailto.
  3. ;
  4. ; © W.P.Wilson - north@lantic16.demon.co.uk
  5.  
  6.  
  7. (set type (askchoice (prompt 'What do you want to do?')
  8.                      (help @askchoice-help)
  9.                      (choices 'Install'
  10.                               'Update')))
  11.  
  12. (procedure INS
  13.  (message '\nInstalling:\n\n'
  14.           'The Installing process needs two sections of HTML, a initial part & '
  15.           'an end part.\n'
  16.           'It also needs a local path for the finished HTML to go ready for uploading.\n'
  17.           'Please read help for futher information before proceeding!\n\n'
  18.           'This script "Web.rexx" and ALL associated files are provided '
  19.           'with NO warranties as to the compatibility , reliability etc. '
  20.           'Also if this program should do ANY type of damage to the user, the '
  21.           'computer hardware or software or anything else I AND no-one else may '
  22.           'be directly or indirectly connected with the fault -\n\n'
  23.           '* You use this script at your own risk! *')
  24.  
  25.  (set base (pathonly @icon))
  26.  
  27.  (set @default-dest (askdir (prompt 'Select the where you want Weblist & its file putting.\n'
  28.                                     '* A drawer wil NOT be created *')
  29.                             (help 'Just select where you want Weblist.\n'
  30.                                   'A Weblist: assign will be made there from '
  31.                                   'the user-startup on boot.')
  32.                             (default 'Work:')
  33.  )                  )
  34.  
  35.  (set html (askdir (prompt 'Select the where you want chat.html creating.')
  36.                             (help 'chat.html - the filename of the created HTML page. '
  37.                                   'Its path should be somewhere in your local backup '
  38.                                   'of your site.')
  39.                             (default 'Work:Mysitebackupdir/')
  40.  )                  )
  41.  
  42.  (set deftop (cat base '/HTML/default-top'))
  43.  
  44.  (set topsor (askfile (prompt 'Select the inital part of the chat.html.\n'
  45.                                '* Use the default-top one in the html '
  46.                                'drawer in you haven\'t made one *')
  47.                        (help 'The initial part is the bit containing the <HTML> & <BODY> '
  48.                              'tags & anything else you want to add such as a logo & help texts.')
  49.                        (default deftop)
  50.  )            )
  51.  
  52.  (set defbot (cat base '/HTML/default-end'))
  53.  
  54.  (set botsor (askfile (prompt 'Select the end part of the chat.html.\n'
  55.                                '* Use the default-end one in the html '
  56.                                'drawer in you haven\'t made one *')
  57.                        (help 'The end part is the bit containing the </HTML> & </BODY> '
  58.                              'tags & anything else you want to add such as a logo & help texts.')
  59.                        (default defbot)
  60.  )            )
  61.  
  62.  (ID)
  63. ; (MAILTO)
  64.  
  65.  (set exe (tackon base 'Install'))
  66.  (set fil (tackon @default-dest 'HTML'))
  67.  (set buf (cat base '/HTML/buffer'))
  68.  (set htm (tackon @default-dest 'htmlpath'))
  69.  (set cha (cat base '/HTML/chat.html'))
  70.  
  71.  (copyfiles (source exe)
  72.             (dest @default-dest)
  73.             (infos)
  74.             (all)
  75.  )
  76.  
  77.  (copyfiles (source topsor)
  78.             (dest fil)
  79.  )
  80.  
  81.  (copyfiles (source botsor)
  82.             (dest fil)
  83.  )
  84.  
  85.  (copyfiles (source buf)
  86.             (dest fil)
  87.  )
  88.  
  89.  (textfile (dest htm)
  90.            (append html)
  91.  )
  92.  
  93.  (copyfiles (source cha)
  94.             (dest html)
  95.  )
  96.  
  97.  (startup 'WebChat' (prompt 'WebChat needs a WebChat assign to be made.')
  98.                     (help 'This will edit your user-startup.')
  99.                     (command (cat 'ASSIGN WebChat: ' @default-dest))
  100.  )
  101. )
  102.  
  103. (procedure ID
  104.  
  105.  (message '\nWhen decoding a <FORM> output mail the script checks for '
  106.           'a predefined formid given by\n(chat is the default ID):\n\n'
  107.           '<INPUT type="HIDDEN" name="formid" value="chat">\n\n\n'
  108.           'This is used to check the script is not decoding an '
  109.           'incorrect mail.')
  110.  
  111.  (set NID (askstring (prompt 'Type in the chosen ID:\n'
  112.                              'Leave as chat if using default top/bottom files.')
  113.                      (help 'If you are starting with default files then use chat '
  114.                            'as the ID. Else choose the one your own web code defines.')
  115.                      (default 'chat')
  116.  )        )
  117.  
  118.  (textfile (dest 'ENVARC:Webchat.pref')
  119.            (append  NID)
  120.  )
  121. )
  122.  
  123. (procedure UPD
  124.  
  125.  (message '\nUpdate:\n\n'
  126.           'This will allow you to change your '
  127.           'initial & end parts of the html.\n'
  128.           'It will also allow you to change your '
  129.           '<FORM> ID.')
  130.  
  131.  (set ass 'WebChat:')
  132.  (set fil (cat ass 'HTML'))
  133.  (set deftop (cat fil '/default-top'))
  134.  (set defbot (cat fil '/default-bot'))
  135.  
  136.  (set topsor (askfile (prompt 'Select the inital part of the chat.html.\n'
  137.                                '* Use the default-top one in the html '
  138.                                'drawer in you haven\'t made one *')
  139.                        (help 'The initial part is the bit containing the <HTML> & <BODY> '
  140.                              'tags & anything else you want to add such as a logo & help texts.')
  141.                        (default deftop)
  142.  )            )
  143.  
  144.  (set botsor (askfile (prompt 'Select the end part of the chat.html.\n'
  145.                                '* Use the default-end one in the html '
  146.                                'drawer in you haven\'t made one *'
  147.                                ' - but remember to put in your email '
  148.                                'address in the mailto:')
  149.                        (help 'The end part is the bit containing the </HTML> & </BODY> '
  150.                              'tags & anything else you want to add such as a logo & help texts.')
  151.                        (default defbot)
  152.  )            )
  153.  
  154.  (ID)
  155.  
  156.  (copyfiles (source topsor)
  157.             (dest fil)
  158.  )
  159.  
  160.  (copyfiles (source botsor)
  161.             (dest fil)
  162.  )
  163.  
  164.  (copyfiles (source buf)
  165.             (dest fil)
  166.  )
  167.  
  168. )
  169.  
  170. ;(procedure MAILTO
  171. ;)
  172.  
  173. ;(procedure UNI
  174. ;(message 'Uninstall')
  175. ;)
  176.  
  177. (if (= type 0) (INS))
  178. (if (= type 1) (UPD))
  179. ;(if (= type 2) (UNI))
  180.  
  181. (exit)